package com.uniledger.test;

import android.arch.persistence.room.Room;
import android.support.multidex.MultiDexApplication;

import com.uniledger.test.model.db.SeeleDatabase;

public class App extends MultiDexApplication {


    private static App app;
    private SeeleDatabase db;


    @Override
    public void onCreate() {
        super.onCreate();
        app = this;
        initApp();
    }

    private void initApp() {

        initDb();
    }

    /**
     * 初始化数据库
     */
    private void initDb() {
        db = Room.databaseBuilder(this,
                SeeleDatabase.class, "seele-wallet-db").build();
    }

    public static App getApp() {
        return app;
    }

    public SeeleDatabase getDb() {
        return db;
    }
}
